import 'dart:developer';

import '../match/expert_views_entity.dart';

class LivePlanEntity{
  List<PlanEntity>? recommend;
  List<PlanEntity>? other;

  LivePlanEntity({this.recommend,this.other});

  LivePlanEntity.fromJson(Map<String, dynamic> json) {
    try {
      if (json['recommend'] != null) {
        recommend = <PlanEntity>[];
        json['recommend'].forEach((v) {
          recommend!.add(new PlanEntity.fromJson(v));
        });
      }
      if (json['other'] != null) {
        other = <PlanEntity>[];
        json['other'].forEach((v) {
          other!.add(new PlanEntity.fromJson(v));
        });
      }
    }catch (e){
      log(e.toString());
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.recommend != null) {
      data['recommend'] = this.recommend?.map((v) => v.toJson()).toList();
    }
    if (this.other != null) {
      data['other'] = this.other?.map((v) => v.toJson()).toList();
    }
    return data;
  }
}